package com.read.consumer.dubboconsumer;

import com.alibaba.dubbo.config.annotation.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import read.servie.HelloService;

/**
 *
 *
 */
@RestController
public class HelloController {

    @Reference
    private HelloService helloService;

    private static final Logger logger = LoggerFactory.getLogger(HelloController.class);

    @RequestMapping("/hello")
    public  String hello(String name) {

        String hello = helloService.sayHello(name);
        System.out.println(helloService.sayHello(name));
        logger.info("dubbo-consumer调用完成!");
        return hello;
    }

}
